﻿using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
using System.Web;

namespace TestProject
{
	public class Generic
	{
		public void Test1()
		{
			string text = @"Do you like egg or hum?
		                            I like Egg!
									U like Hum!";
			Dictionary<string, int> frequent = DictionaryTest.GetWord(text);
			foreach (var entry in frequent)
			{
				string key = entry.Key;
				int value = entry.Value;
				Console.WriteLine("{0}:{1}", key, value);
			}

			//Outer<int>.AppDomainDemo();
			//Outer<int>.Inner<string, double>.DummyMethod();
			//Outer<DateTime>.Inner<string, int>.DummyMethod();
			//Outer<dynamic>.Inner<float, double>.DummyMethod();
			//Outer<byte>.Inner<bool, double>.DummyMethod();
			//DictionaryTest.CompareTest();
			//	List<string> list = DictionaryTest.MakeList<string>("line 1","line 2");
			//	foreach (var value in list)
			//	{
			//		Console.WriteLine(value);
			//	}
			Assembly SampleAssembly;
			SampleAssembly = Assembly.LoadFrom(@"c:\Sample.Assembly.dll");
			MethodInfo Method = SampleAssembly.GetTypes()[0].GetMethod("Method1");
			ParameterInfo[] Params = Method.GetParameters();
			foreach (ParameterInfo Param in Params)
			{
				Console.WriteLine("Param=" + Param.Name.ToString());
				Console.WriteLine("  Type=" + Param.ParameterType.ToString());
				Console.WriteLine("  Position=" + Param.Position.ToString());
				Console.WriteLine("  Optional=" + Param.IsOptional.ToString());
			}
			Thread.Sleep(1000);
			string filePath = HttpRuntime.AppDomainAppPath + "bin\\";
			List<string> files = Directory.GetFiles(filePath, "*.dll", SearchOption.TopDirectoryOnly).ToList();
			try
			{
				if (true)
				{
				}
			}
			catch
			{
				throw new Exception
				{
				};
			}
		}
	}
}
